<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <title>Bootstrap侧边栏停靠案例</title>
    <style>
        .affixed-element-top.affix {
            top: 10px
        }
        
        .affixed-element-top.affix-bottom {
            position: relative;
        }
        
        .affixed-element-bottom.affix {
            bottom: 10px;
        }
        
        .affixed-element-bottom.affix-bottom {
            position: relative;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="col-md-3">
            <ul class="list-group affixed-element-top js-affixed-element-top">
                <li class="list-group-item">THis is Me</li>
                <li class="list-group-item">THis is Me</li>
                <li class="list-group-item">THis is Me</li>
                <li class="list-group-item">THis is Me</li>
                <li class="list-group-item">THis is Me</li>
                <li class="list-group-item">THis is Me</li>
            </ul>
        </div>
        <div class="col-md-6 js-affixed-content">
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
            <p>Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. The .affix, .affix-top, and .affix-bottom classes are added to or removed from the affixed content according to the new state.
                This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content.</p>
        </div>
        <div class="col-md-3">
            <ul class="list-group affixed-element-bottom js-affixed-element-bottom">
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
                <li class="list-group-item">THis is Me fdfas fds f dsff sdfasfsd afa</li>
            </ul>
        </div>
    </div>
    <script src="../js/jquery-1.12.4.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script>
        $(".js-affixed-element-top").affix({
            offset: {}
        })
        $(".js-affixed-element-bottom").affix({
            offset: {
                bottom: 200
            }
        })
    </script>
</body>

</html>